import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { TransformInterceptor } from './transforminterceptor';
import Validate from './auth/rules/validate';
async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.useStaticAssets('uploads', { prefix: '/uploads' });
  app.useGlobalPipes(new Validate());
  //定义全局响应拦截器
  app.useGlobalInterceptors(new TransformInterceptor());
  //定义跨域资源共享
  app.enableCors();
  await app.listen(3000);
}
bootstrap();
